package com.itsm.xkitsm.liferoot.adapter;

import java.util.List;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;
import com.itsm.xkitsm.liferoot.R;
import com.itsm.xkitsm.liferoot.life.weather.Info_province;

public class MyBaseAdapter_sp extends BaseAdapter {
	private Context context;
	private List<Object> data;

	public MyBaseAdapter_sp(Context context, List<Object> data) {
		super();
		this.context = context;
		this.data = data;
	}

	public int getCount() {
		// TODO Auto-generated method stub
		return data.size();
	}

	@Override
	public Object getItem(int arg0) {
		// TODO Auto-generated method stub
		return data.get(arg0);
	}

	@Override
	public long getItemId(int arg0) {
		// TODO Auto-generated method stub
		return arg0;
	}

	@Override
	public View getView(int arg0, View arg1, ViewGroup arg2) {
		// TODO Auto-generated method stub
		View view = LayoutInflater.from(context)
				.inflate(R.layout.item_sp, null);
		TextView tv_show = (TextView) view.findViewById(R.id.tv_showprovince);
		tv_show.setText(((Info_province) data.get(arg0)).getProvince());
		return view;
	}
}
